// pages/youhui/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    getResource: [],
    navdata: {
      img: 3,
      text: 3
    }
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    wx.request({
      url: 'https://jiaoyu.mogochina.com/public/index.php/api/get_article',
      data: {
        ident: 'discount'
      },
      success: function (res) {
        var getResource = res.data.data;
        that.setData({
          getResource
        });
      },
      fail: function (e) {
        wx.showToast({
          title: '网络异常！err:getsessionkeys',
          duration: 2000
        });
      }
    })
  },
  onShareAppMessage(res) {
    if (res.from === 'button') {
      // 来自页面内转发按钮
      console.log(res.target)
    }
    return {
      title: '龙门尚学教育',
      path: '/pages/youhui/index'
    }
  }
})